package models

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Phone    string `gorm:"type:char(11);not null;commit:'手机号'"`
	Password string `gorm:"type:char(32);not null;commit:'密码'"`
	Status   int64  `type:"int;default:1;not null;commit:'商品上下架: 1-正常,2-冻结'"`
}

func (u *User) UserById() error {
	return DB.Debug().Where("status=1").Limit(1).Find(&u).Error
}
